home *** CD-ROM | disk | FTP | other *** search
- /* graphdefaults */
- #include <stdio.h>
- #include <graphics.h>
-
- main()
- {
- int graphdriver = DETECT,graphmode;
- struct viewporttype cur_view;
- char buffer[80];
- /* Initialize the graphics system */
- initgraph(&graphdriver,&graphmode,"c:\\turboc");
- outtextxy(10,20,"Demonstrating graphdefaults");
- /* Define a viewport with clipping ON */
- setviewport(10,100,300,300,1);
- /* Select colors and line style */
- setcolor(RED);
- setlinestyle(DASHED_LINE,0,THICK_WIDTH);
- /* Draw a line from (10,50) to (getmaxx(),50) to
- illustrate the viewpoint */
- line(10,50,getmaxx(),50);
- /* Now revert to default settings */
- outtextxy(10,20,"Press a key to call graphdefaults");
- getch();
- graphdefaults();
- /* Repeat previous line drawing command to show result */
- line(10,50,getmaxx(),50);
- outtextxy(10,270,"Press any key to exit:");
- getch();
- closegraph(); /* Close graphics system */
- }